const mongoose = require("mongoose")
const Schema = mongoose.Schema

// Create Schema
const UserSchema = new Schema({
  // 姓名
  name: {
    type: String,
    required: true
  },
  // 性别
  sex: {
    type: String,
  },
  // 年龄
  age: {
    type: Number,
  },
  // 身份证号
  number: {
    type: String,
    required: true
  },
  // 手机号
  telephone: {
    type: String,
    required: true
  },
  // 密码
  password: {
    type: String,
    required: true
  },
  // 收货地址
  UserAddress: {
    type: String
  },
  // 角色信息
  role: {
    type: String,
    required: true
  },
  // 出生日期
  date: {
    type: Date,
    default: new Date().getTime()
  }
})

module.exports = User = mongoose.model("users", UserSchema);